<!-- 404页面 -->
<template>
  <view class="page-not-found" :style="{ height: windowHeight + 'px' }">
    <view class="error-message" :style="{ height: windowHeight - 70 + 'px' }">
      <view class="ngcontent-c1">很抱歉！</view>
      <view class="ngcontent-c2">你要访问的页面不存在</view>
      <block class="ngcontent-c3">
        <text>别担心，浏览我们的</text>
        <text class="ngcontent-c4" @click="_backhome">首页</text>
        <text>你便可找到想要的信息。</text>
      </block>
    </view>
  </view>
</template>

<script>
import api from '@/api/api';
import tip from '@/utils/tip';
import { MERCHANT_INFO, CUSTOMER_INFO, SYSTEM_INFO } from '@/utils/constant';
export default {
  config: {
    navigationBarTitleText: '小程序商城'
  },
  onLoad() {
    let pages = getCurrentPages();
    var currPage = pages[pages.length - 1]; //当前页面
    this.nowPages = currPage.route;
  },
  onShow() {
   getApp().cl_tracker.track('mini_program_view', {
         path:  this.nowPages,
         pageName: '你要访问的页面不存在',
       })
  },
  methods: {
    _backhome() {
      // uni.switchTab({
      uni.relaunch({
        url: '/pages/home/home'
      });
    }
  }
};
</script>

<style lang="less" scoped>
.page-not-found {
  width: 100%;
  color: #444;
}

.error-message {
  width: 100%;
  font-size: 30rpx;
  padding-top: 120px;
  text-align: center;
}

.ngcontent-c1 {
  margin: 0 0 1em;
  font-size: 48rpx;
}

.ngcontent-c2 {
  margin: 0 0 1em;
  font-size: 52rpx;
}

.ngcontent-c4 {
  border-bottom: 2rpx solid #444;
}
</style>
